<include file="public@head" />
</head>

<body>
    <div class="layui-fluid wrap" id="component-tabs">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">邮箱配置</div>
                    <div class="layui-card-body">
                        <div class="layui-tab">
                            <ul class="layui-tab-title">
                                <li class="layui-this"><a href="{:url('mailer/index')}">{:lang('ADMIN_MAILER_INDEX')}</a></li>
                                <li><a href="{:url('mailer/template',['template_key'=>'verification_code'])}">验证码邮件模板</a></li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <form method="post" class="layui-form js-ajax-form" action="{:url('Admin/mailer/indexPost')}">
                                        <div class="layui-form-item">
                                            <label for="input-from_name" class="layui-form-label">
                                                <span style="color:#ff5722;">*</span>
                                                {:lang('SENDER_NAME')}
                                                <a href="http://www.thinkcmf.com/faq.html?url=https://www.kancloud.cn/thinkcmf/faq/493502" title="查看帮助手册" data-toggle="tooltip" target="_blank"><i class="fa fa-question-circle"></i></a>
                                            </label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-from_name" name="from_name" value="{$from_name|default=''}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-from" class="layui-form-label">
                                                <span style="color:#ff5722;">*</span>{:lang('SENDER_EMAIL_ADDRESS')}
                                            </label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-from" name="from" value="{$from|default=''}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-host" class="layui-form-label">
                                                <span style="color:#ff5722;">*</span>{:lang('SENDER_SMTP_SERVER')}
                                            </label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-host" name="host" value="{$host|default=''}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="js-smtpsecure" class="layui-form-label">
                                                <span style="color:#ff5722;">*</span>连接方式
                                            </label>
                                            <div class="layui-input-block">
                                                <select name="smtp_secure" id="js-smtpsecure">
                                                    <option value="">默认</option>
                                                    <option value="ssl">ssl</option>
                                                    <option value="tls">tls</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-port" class="layui-form-label">
                                                <span style="color:#ff5722;">*</span>SMTP端口
                                            </label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-port" name="port" value="{$port|default=''}" placeholder="默认为25">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-login_name" class="layui-form-label">
                                                <span style="color:#ff5722;">*</span>{:lang('SMTP_MAIL_ADDRESS')}
                                            </label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" id="input-login_name" name="username" value="{$username|default=''}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <label for="input-password" class="layui-form-label">
                                                <span style="color:#ff5722;">*</span>{:lang('SMTP_MAIL_PASSWORD')}
                                            </label>
                                            <div class="layui-input-block">
                                                <input type="password" class="layui-input" id="input-password" name="password" value="{$password|default=''}">
                                            </div>
                                        </div>
                                        <div class="layui-form-item layui-layout-admin">
                                            <div class="layui-input-block">
                                                <div class="layui-footer" style="left: 0;">
                                                    <button type="submit" class="layui-btn js-ajax-submit">{:lang('SAVE')}</button>
                                                    <a class="layui-btn layui-btn-warm" href="javascript:parent.openIframeDialog('{:url('mailer/test')}','发送测试邮件',{width:'600px',height:'400px'});">测试邮件</a>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <include file="public@footer" />
    <script src="__TMPL__/public/assets/simpleboot3/js/adminindex.js"></script>
    <script>
    $(function() {
        $('#js-smtpsecure').val("{$smtp_secure|default=''}");
        $('#js-smtpsecure').val("{$smtp_secure|default=''}");
    });
    </script>
</body>

</html>